﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>时代网站信息管理系统-门户版</title>
<link href="{webroot}theme/admin/css/layout.css" rel="stylesheet" type="text/css" />
<link href="{webroot}theme/admin/css/base.css" rel="stylesheet" type="text/css" />
<link href="{webroot}lib/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" type="text/css">
<link href="{webroot}theme/admin/css/iconfont.css" rel="stylesheet" type="text/css" />
<script src="{webroot}lib/js/jquery.js"></script>
<script src="{webroot}lib/js/jquery-migrate-1.1.0.min.js"></script>
<script src="{webroot}lib/js/jquery-ui.min.js"></script>
<script src="{webroot}theme/admin/js/jquery.layout-latest.min.js"></script>
<script src="{webroot}lib/js/jquery.ztree.core-3.5.min.js"></script>
<script src="{webroot}theme/admin/js/admin.js"></script>
<script src="{webroot}lib/dialog/artdialog.js"></script>
<!--[if lt IE 9]>
<script src="{webroot}lib/js/html5.js"></script>
<![endif]-->
<script>
var myLayout;
$(document).ready(function(){
myLayout=$("body").layout({closable:true,resizable:true,maskContents:true,north__spacing_open:0,south__spacing_open:0,west__minSize:200,west__maxSize:500,west__slidable:false}); 
});
var lastCtrl = new Object();
function DoLocation(ctrl)
{
	if(ctrl!=lastCtrl){
		lastCtrl.className="";
	}
	ctrl.className="hover";
	lastCtrl = ctrl;
}
var zNodes=[{id:-1,pId:0,name:"首页",open:true}
,{id:1,pId:-1,name:"管理首页",url:"sd_frame.asp?act=right",target:"iframe_body"}
,{id:2,pId:-1,name:"修改密码",url:"sd_admin.asp?act=editpass",target:"iframe_body"}
,{id:3,pId:-1,name:"退出登录",url:"javascript:;",target:"_parent"}
]

var setting={view:{dblClickExpand:false,showLine:true},data:{simpleData:{enable:true}},callback:{beforeExpand:beforeExpand,onExpand:onExpand,onClick:onClick}};
	var curExpandNode=null;
	function beforeExpand(treeId,treeNode) {
		var pNode=curExpandNode?curExpandNode.getParentNode():null;
		var treeNodeP=treeNode.parentTId?treeNode.getParentNode():null;
		var zTree=$.fn.zTree.getZTreeObj("tree");
		for(var i=0,l=!treeNodeP?0:treeNodeP.children.length;i<l; i++){
			if(treeNode!==treeNodeP.children[i]){zTree.expandNode(treeNodeP.children[i],false);}
		};
		while (pNode){
			if(pNode===treeNode){break;}
			pNode=pNode.getParentNode();
		};
		if(!pNode){singlePath(treeNode);}
	};
	function singlePath(newNode) {
		if (newNode === curExpandNode) return;
		if (curExpandNode && curExpandNode.open==true) {
			var zTree = $.fn.zTree.getZTreeObj("tree");
			if (newNode.parentTId === curExpandNode.parentTId) {
				zTree.expandNode(curExpandNode, false);
			} else {
				var newParents = [];
				while (newNode) {
					newNode = newNode.getParentNode();
					if (newNode === curExpandNode) {
						newParents = null;
						break;
					} else if (newNode) {
						newParents.push(newNode);
					}
				}
				if (newParents!=null) {
					var oldNode = curExpandNode;
					var oldParents = [];
					while (oldNode) {
						oldNode = oldNode.getParentNode();
						if (oldNode) {
							oldParents.push(oldNode);
						}
					}
					if (newParents.length>0) {
						zTree.expandNode(oldParents[Math.abs(oldParents.length-newParents.length)-1], false);
					} else {
						zTree.expandNode(oldParents[oldParents.length-1], false);
					}
				}
			}
		}
		curExpandNode = newNode;
	};
	
	function onExpand(event,treeId,treeNode){curExpandNode=treeNode;};
	
	function onClick(e,treeId,treeNode){
		var zTree=$.fn.zTree.getZTreeObj("tree");
		zTree.expandNode(treeNode,null,null,null,true);
	}
$(function(){
	$.fn.zTree.init($("#tree"),setting,zNodes);
	$("#tree_2_a").click();
	$(".ui-layout-north li:first-child").click();
	$(".menu_left").click(function(){
		var id=$(this).attr("menuid");
		var config=$(this).html();
		$(".left_subject").html("<span>&#xe60c;</span>"+config);
		var db;
		$.ajax({
			type:"post",
			async:false,
			cache:false,
			url:"sd_frame.asp?act=menu&id="+id,
			success:function(_){zNodes=eval(_);}
		})
		$.fn.zTree.init($("#tree"),setting,zNodes);
		$("#tree_2_a").click();
		var url=$("#tree_2_a").attr("href");
		if(!url){url="sd_content.asp?act=list";}
		parent.iframe_body.location=url;
	})
	$("#tree_4_a").click(function(){
		dialog({title:"\u9000\u51fa\u767b\u5f55",content:'\u786e\u5b9a\u8981\u9000\u51fa\u767b\u5f55\uff1f',ok:function(){location.href="login.asp?act=out";},cancel:true}).showModal();
	})
	
});
</script>
</head>
<body>

<div class="ui-layout-north">
    <span><a href="../" target="_blank">预览网站</a><a href="http://help.sdcms.cn" target="_blank">使用手册</a><a href="http://www.sdcms.cn" target="_blank">官方网站</a><a href="sd_cache.asp" target="iframe_body">缓存管理</a><a href="sd_errlog.asp" target="iframe_body">错误日志</a></span>
	<div class="logo"></div>
    <ul>
        <li onClick="DoLocation(this);"><a href="./">首页</a></li>
        {sdcms:rs table="sd_admin_menu" where="followid=0 and islock=1[admin_lever_where]" order="ordnum,id"}
        <li onClick="DoLocation(this);"><a href="javascript:;" class="menu_left" menuid="{$rs[id]}">{$rs[title]}</a></li>
        {/sdcms:rs}
        <li class="last"></li>
    </ul>
</div>

<div class="ui-layout-west">
	<div class="left_subject iconfont"><span>&#xe60c;</span>首页</div>
    <div class="left_tree">
        <!--<ul>
            <li class="hover"><a href="iframe.html" target="iframe_body">管理首页</a></li>
            <li><a href="list.html" target="iframe_body">列表页面</a></li>
            <li><a href="add.html" target="iframe_body">添加页面</a></li>
            <li><a href="add_pic.html" target="iframe_body">组图添加</a></li>
            <li><a href="set.html" target="iframe_body">设置页面</a></li>
            <li><a href="blank.html" target="iframe_body">空白页面</a></li>
        </ul>-->
        <div id="tree" class="ztree"></div>
    </div>
</div>

<!--<div class="ui-layout-south">
	Powered By Sdcms.Cn &copy; 2008-{year(now())} sdcms lab inc.
</div>-->

<div class="ui-layout-center">
	 <iframe name="iframe_body" id="iframe_body" src="sd_frame.asp?act=right" width="100%" height="98.96%" frameborder="0"></iframe>
</div>
</body>
</html>